package net.sh.dpinfrastructure.support.spring.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;

import net.sh.dpinfrastructure.config.DPConfig;
import net.sh.dpinfrastructure.http.DPHttp;
import net.sh.dpinfrastructure.http.DPHttpClientHttp;

/**
 * 
 * 使用httpclient配置http
 * 
 * @version 1.0
 * @since JDK1.7
 * @author shaohui
 * @company 上海朝阳永续信息技术有限公司
 * @copyright (c) 2016 SunTime Co'Ltd Inc. All rights reserved.
 * @date 2016年8月8日 下午2:09:04
 */
@Configuration
@Import(DPConfigConfiguration.class)
public class DPHttpClientConfiguration {

    @Bean(name="httpClient", destroyMethod="closeClient")
    @Primary
    public DPHttp getDPHttpClientHttp(DPConfig config) {
        return new DPHttpClientHttp(config);
    }
    
}
